package com.chint.largeData;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.chint.largeData.tools.ExampleUtil;

public class MessageReceiver extends BroadcastReceiver {
	public static final String MESSAGE_RECEIVED_ACTION = "cn.jpush.android.intent.NOTIFICATION_RECEIVED";
	public static final String KEY_TITLE = "title";
	public static final String KEY_MESSAGE = "message";
	public static final String KEY_EXTRAS = "extras";
	@Override  
	public void onReceive(Context context, Intent intent) {
		if (MESSAGE_RECEIVED_ACTION.equals(intent.getAction())) {
          String messge = intent.getStringExtra(KEY_MESSAGE);
          String extras = intent.getStringExtra(KEY_EXTRAS);
          StringBuilder showMsg = new StringBuilder();
          showMsg.append(KEY_MESSAGE + " : " + messge + "\n");
          if (!ExampleUtil.isEmpty(extras)) {
        	  showMsg.append(KEY_EXTRAS + " : " + extras + "\n");
          }
          setCostomMsg(context,showMsg.toString());
		}
	}
	 private void setCostomMsg(Context ct,String msg){
//			   Toast.makeText(ct, msg, Toast.LENGTH_LONG).show();
		   
		}
}
